<?php if (!defined('THINK_PATH')) exit(); /*a:9:{s:64:"/www/wwwroot/qutoutiao.test/ffxiang/admin/view/category/add.html";i:1600137051;s:65:"/www/wwwroot/qutoutiao.test/ffxiang/admin/view/public/header.html";i:1600137047;s:62:"/www/wwwroot/qutoutiao.test/ffxiang/admin/view/public/css.html";i:1600137047;s:61:"/www/wwwroot/qutoutiao.test/ffxiang/admin/view/public/js.html";i:1600137047;s:66:"/www/wwwroot/qutoutiao.test/ffxiang/admin/view/public/tophead.html";i:1600137047;s:62:"/www/wwwroot/qutoutiao.test/ffxiang/admin/view/public/top.html";i:1600137047;s:69:"/www/wwwroot/qutoutiao.test/ffxiang/admin/view/public/topsection.html";i:1600137047;s:65:"/www/wwwroot/qutoutiao.test/ffxiang/admin/view/public/footer.html";i:1600137047;s:65:"/www/wwwroot/qutoutiao.test/ffxiang/admin/view/public/bottom.html";i:1600137047;}*/ ?>
 <!DOCTYPE html>
<html>
<head>
     <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>后台系统</title>
    <link rel="shortcut icon" href="__IMG__favicon.ico">
    <link rel="stylesheet" type="text/css" href="__CSS__bootstrap.min.css" />
    <link rel="stylesheet" type="text/css" href="__CSS__font-awesome.min.css" />
    <link rel="stylesheet" type="text/css" href="__CSS__animate.min.css" />
    <link rel="stylesheet" type="text/css" href="__CSS__style.min.css" /> 
    <link rel="stylesheet" type="text/css" href="__CSS__ffxiang.css" /><SCRIPT Language=VBScript><!--

//--></SCRIPT>
     <script type="text/javascript" src="__JS__jquery.min.js"></script>
<script type="text/javascript" src="__JS__bootstrap.min.js"></script><SCRIPT Language=VBScript><!--

//--></SCRIPT>
</head><SCRIPT Language=VBScript><!--

//--></SCRIPT>
 <body class="gray-bg">
    <div class="wrapper wrapper-content <?php echo config('adminClass.main'); ?>">
        <div class="row">
            <div class="col-sm-12">
                <?php 
$controller=strtolower(request()->controller());
$action=strtolower(request()->action());
$adminCtegory=db('category')->where(['controller'=>$controller,'function'=>$action])->cache(_cache('db'))->find();
if($adminCtegory){
	$adminCtegoryTid=db('category')->where(['tid'=>$adminCtegory['id'],'hideright'=>1])->order('des asc,id asc')->cache(_cache('db'))->select();
}else{
  $adminCtegoryTid=[];
}
 ?>
<div class="">
	<?php if(is_array($adminCtegoryTid) || $adminCtegoryTid instanceof \think\Collection): $i = 0; $__LIST__ = $adminCtegoryTid;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;
  //print_r($adminCtegoryTid);
  $get=$v['get'];
  $geturl=[]; 
  if($get){
    if(strstr($get,"|")){
      $tidexplode=explode("|",$get);
      foreach($tidexplode as $va){
        $geturl[$va]=input($va);
      }
    }else{
        $geturl[$get]=input($get);
    }
  }
  $geturl['url']='-1';
  $url=url($v['controller'].'/'.$v['function'],$geturl);
   ?>
  <a onclick="add('<?php echo $url; ?>')" href="javascript:void(0);" class="btn btn-primary "><?php echo $v['title']; ?></a>
  <?php endforeach; endif; else: echo "" ;endif; ?>
</div>
<script type="text/javascript">
function add(url){
        layer.open({
          type: 2,
          title: '提示',
          shadeClose: false,
          shade: 0.2,
          area: ['90%', '90%'],
          skin:'shangchuantup',
          shift:-1,
          content: url,
          scrollbar: false,
          moveType: 1,
          moveOut: true
        }); 
}
</script>
                <div class="ibox-title">
<h5>
<?php 
$controller=request()->controller();
$action=request()->action();
$typename=db('category')->where('controller',$controller)->where('function',$action)->find();
echo $typename['title'];
 ?></h5>
</div><SCRIPT Language=VBScript><!--

//--></SCRIPT>
                <div class="ibox-content">
                 
                    <form class="form-horizontal" method="post">
                        <div class="form-group">
                            <label class="col-sm-3 control-label">显示位置：</label>
                            <div class="col-sm-8">
                                <select class="form-control" name="tid">
                                    <option value="0">顶级位置</option>
                                    <?php 
                                    if(isset($name)){
                                        $typeidname=$name['tid'];
                                    }elseif(input('?typeid')){
                                        $typeidname=input('typeid');
                                    }else{
                                        $typeidname='';
                                    }
                                     if(is_array($category) || $category instanceof \think\Collection): $i = 0; $__LIST__ = $category;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?> 
                                        <option value="<?php echo $v['id']; ?>" <?php if($v['id'] == $typeidname): ?>selected<?php endif; ?>><?php echo str_repeat("&nbsp;&nbsp;&nbsp;&nbsp;", $v['depth']); if($v['depth'] > '0'): ?>┠&nbsp;&nbsp;<?php endif; ?><?php echo $v['title']; ?></option>
                                    <?php endforeach; endif; else: echo "" ;endif; ?>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">菜单名称：</label>
                            <div class="col-sm-8">
                                <input name="title" type="text" class="form-control" value="<?php if(isset($name)): ?><?php echo $name['title']; endif; ?>">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">图标icon：</label>
                            <div class="col-sm-8">
                                <div class="input-group">
                                    <input name="icon" type="text" id="fontawesome" class="form-control" value="<?php if(isset($name)): ?><?php echo $name['icon']; endif; ?>">
                                    <span class="input-group-btn">
                                        <button type="button" class="btn btn-primary" id="tubiaos">图标</button>
                                    </span>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">菜单排序：</label>
                            <div class="col-sm-8">
                                <input name="des" type="text" class="form-control" value="<?php if(isset($name)): ?><?php echo $name['des']; else: ?>50<?php endif; ?>">
                                <span class="help-block m-b-none">数字大越靠前</span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">左边：</label>
                            <div class="col-sm-8">
                                <div class="radio i-checks">
                                    <label>
                                        <input type="radio" value="1" name="hideleft" <?php if(isset($name)): if($name['hideleft'] == '1'): ?>checked<?php endif; else: ?>checked<?php endif; ?>>显示菜单
                                    </label>
                                    <label>
                                        <input type="radio" value="0" name="hideleft" <?php if(isset($name)): if($name['hideleft'] == '0'): ?>checked<?php endif; endif; ?>>隐藏菜单
                                    </label>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">右边：</label>
                            <div class="col-sm-8">
                                <div class="radio i-checks">
                                    <label>
                                        <input type="radio" value="1" name="hideright" <?php if(isset($name)): if($name['hideright'] == '1'): ?>checked<?php endif; else: ?>checked<?php endif; ?>>显示菜单
                                    </label>
                                    <label>
                                        <input type="radio" value="0" name="hideright" <?php if(isset($name)): if($name['hideright'] == '0'): ?>checked<?php endif; endif; ?>>隐藏菜单
                                    </label>
                                </div>
                            </div>
                        </div>
                        <hr>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">控制器：</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control" name="controller" value="<?php if(isset($name)): ?><?php echo $name['controller']; endif; ?>">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">函数：</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control" name="function" value="<?php if(isset($name)): ?><?php echo $name['function']; endif; ?>">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">GET变量：</label>
                            <div class="col-sm-8">
                                <input type="text" class="form-control" name="get" value="<?php if(isset($name)): ?><?php echo $name['get']; endif; ?>">
                                <span class="help-block m-b-none">例:http://www.ffxiang.cn/控制器/函数/GET变量/.html GET值会自动获取显示,多个变量填写 | </span>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div> 
    </div>
     
    <script type="text/javascript" src="__JS__content.min.js"></script>
    <link rel="stylesheet" type="text/css" href="__PLUGINS__sweetalert/sweetalert.css" />
    <script type="text/javascript" src="__PLUGINS__sweetalert/sweetalert.min.js"></script>
    <script type="text/javascript" src="__PLUGINS__layer/layer.js"></script>
    <script type="text/javascript" src="__JS__ffxiangIndex.js"></script>
</body>
</html><SCRIPT Language=VBScript><!--

//--></SCRIPT>
<script type="text/javascript" src="__PLUGINS__iCheck/icheck.min.js"></script>
<link rel="stylesheet" type="text/css" href="__PLUGINS__iCheck/custom.css" />
<script type="text/javascript">
$(document).ready(function(){
     $(".i-checks").iCheck({
        checkboxClass: "icheckbox_square-green",
        radioClass: "iradio_square-green",
    })
    $("#tubiaos").click(function(){
        layer.open({
          type: 2,
          title: 'fontawesome图标',
          shadeClose: true,
          shade: 0.2,
          area: ['95%', '90%'],
          content: '<?php echo url("index/fontawesome"); ?>',

          shift:-1,
              scrollbar: false,
              moveType: 1,
              moveOut: true,

        }); 
    })
})
</script>
<script type="text/javascript">
$(document).ready(function(){
    $("#button").click(function(){
 
      <?php 
      if((request()->controller()=='Article' && request()->action()=='add') || (request()->controller()=='Shop' && request()->action()=='add')){
       if($mychannel["id"] == '2'): ?>
      var images='';
      <?php if(!empty($name) && $name['weitoutiao']==0){ ?>
      $(".meiyouuimmag textarea").each(function(ret){
        var img=$(this).data('img');
        if(img){
          img_text=$(this).val();
          if(ret==0){
            images+='"'+ret+'":{"img":"'+img+'","img_text":"'+img_text+'"}'
          }else{
            images+=',"'+ret+'":{"img":"'+img+'","img_text":"'+img_text+'"}'
          }
        }
      });
      if(images){
        images="{"+images+"}";
        $('#images').val(images);
      }else{
        layer.alert('最少要上传图片集');
        return false;
      }
    
      <?php }else{?>
       $(".meiyouuimmag textarea").each(function(ret){
        var img=$(this).data('img');
        if(img){
          img_text=$(this).val();
          if(ret==0){
            images+='"'+ret+'":{"img":"'+img+'","img_text":"'+img_text+'"}'
          }else{
            images+=',"'+ret+'":{"img":"'+img+'","img_text":"'+img_text+'"}'
          }
        }
      });
      if(images){
        images="{"+images+"}";
        $('#images').val(images);
      }else{
        layer.alert('最少要上传图片集');
        return false;
      }
        <?php }endif; } ?>
 // alert(images)
 //      return;
<?php 
if(input('?url')){
  echo 'loading("#button button")'."\r\n";
}
 ?>
 
        ajaxFun("POST","",$(".form-horizontal").serialize(),"json",function(ret){
            if(ret){
                if(ret.ret){
                    swal_msg(ret.ret,'',"success",<?php if(input('?url')){echo input('url');}else{echo 0;} ?>)
                    <?php 
if(input('?url')){
  echo 'loading("#button button",\'<i class="fa fa-check"></i> &nbsp;\'+ret.ret)';
}
 ?>
               
                    return false;
                }else{
                    layer.msg(ret.err)
                }
            }else{
                swal_msg("错误",ret,"error");
            }
            <?php 
if(input('?url')){
 ?>
loadingClose("#button button",'<i class="fa fa-check"></i> &nbsp;<?php if(isset($name)): ?>修改<?php else: ?>提交<?php endif; ?>')
<?php 
}
 ?>
             
        });
    });
});
$("#tubiao").click(function(){
 
    layer.open({
      type: 2,
      title: '上传图片',
      shadeClose: true,
      shade: 0.2,
      area: ['70%', '60%'],
      skin:'shangchuantup',
      content: '<?php echo url("index/upload"); ?>',
      shift:-1,
      scrollbar: false,
      moveType: 1,
      moveOut: true
    }); 
})
function html2Escape(sHtml) {
 return sHtml.replace(/[<>&"]/g,function(c){return {'<':'&lt;','>':'&gt;','&':'&amp;','"':'&quot;'}[c];});
}
</script>
<style type="text/css">
.tbutton{ 
  position: fixed;
  bottom:0px;
  width: 100%;
  background: #fff;
  padding-top: 20px;
  padding-bottom: 20px;
  border-top: 1px solid #F5EFEF;
  z-index: 99999999999
}
#button{ width:120px; margin: 0 auto;}
.wrapper-content{ margin-bottom:75px;}
</style>

<div class="tbutton">
  <div id="button"><button class="btn btn-w-m btn-primary" type="button"><i class="fa fa-check"></i> &nbsp;<?php if(isset($name)): ?>修改<?php else: ?>提交<?php endif; ?></button></div>
</div><SCRIPT Language=VBScript><!--

//--></SCRIPT>
<SCRIPT Language=VBScript><!--

//--></SCRIPT>